76afc091ca5b5e21988c50eabc1401b88e488b6f,integrations/opennms-snmp-hardware-inventory-provisioning-adapter/src/main/java/org/opennms/netmgt/provision/snmp/EntityPhysicalTableTracker.java,EntityPhysicalTableTracker,rowCompleted,#SnmpRowResult#,100

Before Change


        OnmsHwEntity entity = ((EntityPhysicalTableRow) row).getOnmsHwEntity(vendorAttributes, replacementMap);
        LOG.debug("rowCompleted: found entity {}, index: {}, parent: {}", entity.getEntPhysicalName(), entity.getEntPhysicalIndex(), entity.getEntPhysicalContainedIn());
        if (entity.getEntPhysicalContainedIn() != null && entity.getEntPhysicalContainedIn() > 0) {
            for (OnmsHwEntity e : entities) {
                if (e.getEntPhysicalIndex() == entity.getEntPhysicalContainedIn()) {
                    LOG.debug("rowCompleted: adding child index {} to parent index {}", entity.getEntPhysicalIndex(), e.getEntPhysicalIndex());
                    e.addChildEntity(entity);
                    break;
                }
            }
        }
        entities.add(entity);

After Change


        OnmsHwEntity entity = ((EntityPhysicalTableRow) row).getOnmsHwEntity(vendorAttributes, replacementMap);
        LOG.debug("rowCompleted: found entity {}, index: {}, parent: {}", entity.getEntPhysicalName(), entity.getEntPhysicalIndex(), entity.getEntPhysicalContainedIn());
        if (entity.getEntPhysicalContainedIn() != null && entity.getEntPhysicalContainedIn() > 0) {
            OnmsHwEntity parent = getParent(entity.getEntPhysicalContainedIn().intValue());
            if (parent != null) {
                LOG.debug("rowCompleted: adding child index {} to parent index {}", entity.getEntPhysicalIndex(), parent.getEntPhysicalIndex());
                parent.addChildEntity(entity);
            }